{include file="public/header" /}
<body class="childrenBody">
	<form class="layui-form">
		<div class="layui-tab">
			<ul class="layui-tab-title">
				<li class="layui-this">基础信息</li>
				<li>技术参数</li>
				<li>产品附件</li>
				<li>产品图片</li>
				<li>尺寸信息</li>
				<li>互换编码</li>
				<li>适用范围</li>
			</ul>
			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show" style="position:static;margin-top:10px;">
					<div class="layui-form-item">
						<label class="layui-form-label">产品编码</label>
						<div class="layui-input-block">
							<input type="text" name="ProductCode" class="layui-input" lay-verify="required" placeholder="请输入产品编码" value="{$view.base.product_code}" >
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">产品名称</label>
						<div class="layui-input-block">
							<input type="text" name="ProductName" class="layui-input" lay-verify="required" placeholder="请输入产品名称" value="{$view.base.product_name}">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">产品类型</label>
						<div class="layui-input-block">
							<select name="ProductType" lay-filter="selectType" lay-search>
								<option value="{$view.base.type_id}">{$view.base.type_name}</option>
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">产品状态</label>
						<div class="layui-input-block">
							<select name="ProductSale" lay-search>
								<option value="0">请选择产品状态</option>
								{volist name="psale" id="f" key="k"}
									<option value="{$k}" {eq name="$view.base.product_sale" value="$k"}selected{/eq}>{$f}</option>
								{/volist}
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">包装单位</label>
						<div class="layui-input-block">
							<input type="text" name="ProductDw" class="layui-input" lay-verify="required" placeholder="请输入包装单位 (单个/每箱/每托)" value="{$view.base.product_dw}">&nbsp;
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">常规适用</label>
						<div class="layui-input-block">
							<textarea name="ProductCg" placeholder="请输入常规适用" class="layui-textarea">{$view.content.product_cg}</textarea>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">产品备注</label>
						<div class="layui-input-block">
							<textarea name="ProductDemo" placeholder="请输入产品备注" class="layui-textarea">{$view.content.product_demo}</textarea>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">是否启用</label>
							<div class="layui-input-block">
								<input type="checkbox" name="show" class="isShow" title="启用" {eq name="$view.base.product_status" value="1"}checked{/eq}>
							</div>
						</div>
					</div>
				</div>
				<div class="layui-tab-item" style="position:static;margin-top:10px;">
					<div class="layui-form-item">
						{php}for($i=1;$i<=10;$i++){{/php}
							{php}$arr = array('一','二','三','四','五','六','七','八','九','十');{/php}
							<div class="layui-inline">
								<label class="layui-form-label">参数 {php}echo $arr[$i-1];{/php}</label>
								<div class="layui-input-inline" style="width: 300px;">
									<input name="param_title_{php}echo $i;{/php}" placeholder="请输入参数标题" autocomplete="off" class="layui-input" type="text" value="{php}echo isset($view['content']['product_params'][$i-1]['title']) ? $view['content']['product_params'][$i-1]['title'] : '';{/php}" >
								</div>
								<div class="layui-form-mid">~</div>
								<div class="layui-input-inline" style="width: 300px;">
									<input name="param_content_{php}echo $i;{/php}" placeholder="请输入参数内容" autocomplete="off" class="layui-input" type="text" value="{php}echo isset($view['content']['product_params'][$i-1]['content']) ? $view['content']['product_params'][$i-1]['content'] : '';{/php}">
								</div>
							</div>
						{php} } {/php}
					</div>
				</div>
				<div class="layui-tab-item" style="position:static;margin-top:10px;">
					<div class="layui-form-item">
						<label class="layui-form-label">图纸</label>
						<div class="layui-upload-drag" id="ProudctTZ">
							<p>点击上传，或将文件拖拽到此处</p>
						</div>
						<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;预览图
							<div class="layui-upload-list" id="TzDiv"></div>
							{if condition=" $view.p_files.tz.TzUrl neq ''"}
								<a href="{$view.p_files.tz.TzAurl}" alt="{$view.p_files.tz.TzName}" class="layui-upload-img">{$view.p_files.tz.TzName}</a>
							{/if}
						</blockquote>
						<input type="hidden" name="TzId" value="{$view.p_files.tz.TzId}" />
						<input type="hidden" name="TzName" value="{$view.p_files.tz.TzName}" />
						<input type="hidden" name="TzUrl" value="{$view.p_files.tz.TzUrl}" />
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">安装说明</label>
						<div class="layui-upload-drag" id="ProudctAZ">
							<p>点击上传，或将文件拖拽到此处</p>
						</div>
						<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;预览图
							<div class="layui-upload-list" id="AzDiv"></div>
							{if condition=" $view.p_files.az.AzUrl neq ''"}
								<a href="{$view.p_files.az.AzAurl}" alt="{$view.p_files.az.AzName}" class="layui-upload-img">{$view.p_files.az.AzName}</a>
							{/if}
						</blockquote>
						<input type="hidden" name="AzId" value="{$view.p_files.az.AzId}" />
						<input type="hidden" name="AzName" value="{$view.p_files.az.AzName}" />
						<input type="hidden" name="AzUrl" value="{$view.p_files.az.AzUrl}" />
					</div>
				</div>
				<div class="layui-tab-item" style="position:static;margin-top:10px;">
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">图1</label>
							<div class="layui-upload-drag" id="ProudctImg1">
								<p>点击上传，或将文件拖拽到此处</p>
							</div>
						</div>
						<div class="layui-inline">
							<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">预览图
								<div class="layui-upload-list" id="Img1Url"></div>
								{if condition=" $view.files.0.file_url neq ''"}
									<img src="{$view.files.0.file_all_url}" alt="{$view.files.0.file_name}" class="layui-upload-img" width="100" height="60" />
								{/if}
							</blockquote>
							<input type="hidden" name="Img1Id" value="{$view.files.0.id}" />
							<input type="hidden" name="Img1Name" value="{$view.files.0.file_name}" />
							<input type="hidden" name="Img1Ourl" value="{$view.files.0.file_url}" />
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">排序值</label>
							<div class="layui-input-block">
								<input type="text" name="Img1Sort" class="layui-input" lay-verify="required" placeholder="请输入排序值" value="{$view.files.0.file_sort}" >
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">是否水印</label>
							<div class="layui-input-block">
								<input type="radio" name="Img1Mark" value="1" title="是">
								<input type="radio" name="Img1Mark" value="0" title="否" checked >
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">图2</label>
							<div class="layui-upload-drag" id="ProudctImg2">
								<p>点击上传，或将文件拖拽到此处</p>
							</div>
						</div>
						<div class="layui-inline">
							<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">预览图
								<div class="layui-upload-list" id="Img2Url"></div>
								{if condition=" $view.files.1.file_url neq ''"}
									<img src="{$view.files.1.file_all_url}" alt="{$view.files.1.file_name}" class="layui-upload-img" width="100" height="60" />
								{/if}
							</blockquote>
							<input type="hidden" name="Img2Id" value="{$view.files.1.id}" />
							<input type="hidden" name="Img2Name" value="{$view.files.1.file_name}" />
							<input type="hidden" name="Img2Ourl" value="{$view.files.1.file_url}" />
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">排序值</label>
							<div class="layui-input-block">
								<input type="text" name="Img2Sort" class="layui-input" lay-verify="required" placeholder="请输入排序值" value="{$view.files.1.file_sort}" >
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">是否水印</label>
							<div class="layui-input-block">
								<input type="radio" name="Img2Mark" value="1" title="是">
								<input type="radio" name="Img2Mark" value="0" title="否" checked >
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">图3</label>
							<div class="layui-upload-drag" id="ProudctImg3">
								<p>点击上传，或将文件拖拽到此处</p>
							</div>
						</div>
						<div class="layui-inline">
							<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">预览图
								<div class="layui-upload-list" id="Img3Url"></div>
								{if condition=" $view.files.2.file_url neq ''"}
									<img src="{$view.files.2.file_all_url}" alt="{$view.files.2.file_name}" class="layui-upload-img" width="100" height="60" />
								{/if}
							</blockquote>
							<input type="hidden" name="Img3Id" value="{$view.files.2.id}" />
							<input type="hidden" name="Img3Name" value="{$view.files.2.file_name}" />
							<input type="hidden" name="Img3Ourl" value="{$view.files.2.file_url}" />
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">排序值</label>
							<div class="layui-input-block">
								<input type="text" name="Img3Sort" class="layui-input" lay-verify="required" placeholder="请输入排序值" value="{$view.files.2.file_sort}" >
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">是否水印</label>
							<div class="layui-input-block">
								<input type="radio" name="Img3Mark" value="1" title="是">
								<input type="radio" name="Img3Mark" value="0" title="否" checked >
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">图4</label>
							<div class="layui-upload-drag" id="ProudctImg4">
								<p>点击上传，或将文件拖拽到此处</p>
							</div>
						</div>
						<div class="layui-inline">
							<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">预览图
								<div class="layui-upload-list" id="Img4Url"></div>
								{if condition=" $view.files.3.file_url neq ''"}
									<img src="{$view.files.3.file_all_url}" alt="{$view.files.3.file_name}" class="layui-upload-img" width="100" height="60" />
								{/if}
							</blockquote>
							<input type="hidden" name="Img4Id" value="{$view.files.3.id}" />
							<input type="hidden" name="Img4Name" value="{$view.files.3.file_name}" />
							<input type="hidden" name="Img4Ourl" value="{$view.files.3.file_url}" />
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">排序值</label>
							<div class="layui-input-block">
								<input type="text" name="Img4Sort" class="layui-input" lay-verify="required" placeholder="请输入排序值" value="{$view.files.3.file_sort}" >
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">是否水印</label>
							<div class="layui-input-block">
								<input type="radio" name="Img4Mark" value="1" title="是">
								<input type="radio" name="Img4Mark" value="0" title="否" checked >
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">图5</label>
							<div class="layui-upload-drag" id="ProudctImg5">
								<p>点击上传，或将文件拖拽到此处</p>
							</div>
						</div>
						<div class="layui-inline">
							<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">预览图
								<div class="layui-upload-list" id="Img5Url"></div>
								{if condition=" $view.files.4.file_url neq ''"}
									<img src="{$view.files.4.file_all_url}" alt="{$view.files.4.file_name}" class="layui-upload-img" width="100" height="60" />
								{/if}
							</blockquote>
							<input type="hidden" name="Img5Id" value="{$view.files.4.id}" />
							<input type="hidden" name="Img5Name" value="{$view.files.4.file_name}" />
							<input type="hidden" name="Img5Ourl" value="{$view.files.4.file_url}" />
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">排序值</label>
							<div class="layui-input-block">
								<input type="text" name="Img5Sort" class="layui-input" lay-verify="required" placeholder="请输入排序值" value="{$view.files.4.file_sort}" >
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">是否水印</label>
							<div class="layui-input-block">
								<input type="radio" name="Img5Mark" value="1" title="是">
								<input type="radio" name="Img5Mark" value="0" title="否" checked >
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">图6</label>
							<div class="layui-upload-drag" id="ProudctImg6">
								<p>点击上传，或将文件拖拽到此处</p>
							</div>
						</div>
						<div class="layui-inline">
							<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">预览图
								<div class="layui-upload-list" id="Img6Url"></div>
								{if condition=" $view.files.5.file_url neq ''"}
									<img src="{$view.files.5.file_all_url}" alt="{$view.files.5.file_name}" class="layui-upload-img" width="100" height="60" />
								{/if}
							</blockquote>
							<input type="hidden" name="Img6Id" value="{$view.files.5.id}" />
							<input type="hidden" name="Img6Name" value="{$view.files.5.file_name}" />
							<input type="hidden" name="Img6Ourl" value="{$view.files.5.file_url}" />
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">排序值</label>
							<div class="layui-input-block">
								<input type="text" name="Img6Sort" class="layui-input" lay-verify="required" placeholder="请输入排序值" value="{$view.files.5.file_sort}" >
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">是否水印</label>
							<div class="layui-input-block">
								<input type="radio" name="Img6Mark" value="1" title="是">
								<input type="radio" name="Img6Mark" value="0" title="否" checked >
							</div>
						</div>
					</div>
				</div>
				<div class="layui-tab-item" style="position:static;margin-top:10px;">
					<div class="layui-form-item" id="size_list">
						{empty name="size_list"}
							<label class="layui-form-label">尺寸</label>
							<div class="layui-input-block">
								<input type="text" name="" class="layui-input" lay-verify="required" placeholder="请先选择产品类型" disabled>
							</div>
						{else /}
							{volist name="size_list" id="size"}
								<div class="layui-form-item">
									<div class="layui-inline">
										<label class="layui-form-label">{$size.code}</label>
									</div>
									<div class="layui-inline">
										<div class="layui-input-block">
											<input type="text" name="{$size.input}" class="layui-input RoleName" lay-verify="required" placeholder="请输入数值" value="{$size.value}">
										</div>
									</div>
									<div class="layui-inline">
										<label class="layui-form-label">{$size.name}</label>
									</div>
								</div>
							{/volist}
						{/empty}
					</div>
				</div>
				<div class="layui-tab-item" style="position:static;margin-top:10px;">
					<blockquote class="layui-elem-quote news_search">
						<div class="layui-inline">
							<a class="layui-btn layui-btn-normal" id="FactAdd_btn">导入</a>
						</div>
						<div class="layui-inline">
							<a class="layui-btn layui-btn-normal FactDel_btn">删除</a>
						</div>
					</blockquote>
					<table class="layui-table">
						<colgroup>
							<col width="40">
							<col>
							<col width="20%">
							<col width="20%">
							<col width="15%">
							<col width="20%">
						</colgroup>
						<thead>
							<tr>
								<th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChooseCode"></th>
								<th>互换编码</th>
								<th>厂商编码</th>
								<th>厂商名称</th>
								<th>编码类型</th>
								<th>备注</th>
							</tr>  
						</thead>
						<tbody class="news_content" id="fact_list">
							<!--
							<tr>
								<td><input type="checkbox" name="checked" lay-skin="primary" lay-filter="choose"></td>
								<td>AASA</td>
								<td>CQHY</td>
								<td>CQHY</td>
								<td>售后市场</td>
								<td>此号码仅对于中国市场</td>
							</tr>-->
							{notempty name="exchange_list"}
								{volist name="exchange_list" id="exchange" key="k"}
									<tr data-index="{$k-1}">
										<td><input type="checkbox" name="checked" lay-skin="primary" lay-filter="choose"></td>
										<td data-field="exchange_code" data-value="{$exchange.exchange_code}">{$exchange.exchange_code}</td>
										<td data-field="fact_code" data-value="{$exchange.fact_code}">{$exchange.fact_code}</td>
										<td data-field="fact_name" data-value="{$exchange.fact_name}">{$exchange.fact_name}</td>
										{if condition="($exchange.fact_type == 1)"}
											<td data-field="fact_type" data-value="{$exchange.fact_type}">原厂备件</td>
										{else /}
											<td data-field="fact_type" data-value="{$exchange.fact_type}">售后市场</td>
										{/if}
										<td data-field="fact_demo" data-value="{$exchange.fact_demo}">{$exchange.fact_demo}</td>
									</tr>
								{/volist}
							{/notempty}
						</tbody>
						<input type="hidden" name="del_fact_codes" value="" />
					</table>
				</div>
				<div class="layui-tab-item" style="position:static;margin-top:10px;">
					<blockquote class="layui-elem-quote news_search">
						<div class="layui-inline">
							<a class="layui-btn layui-btn-normal MatorAdd_btn">添加</a>
						</div>
						<div class="layui-inline">
							<a class="layui-btn layui-btn-normal MatorDel_btn">删除</a>
						</div>
					</blockquote>
					<div class="layui-form news_list">
						<table class="layui-table">
							<colgroup>
								<col width="40">
								<col>
								<col width="10%">
								<col width="10%">
								<col width="8%">
								<col width="6%">
								<col width="6%">
								<col width="6%">
								<col width="6%">
								<col width="6%">
								<col width="6%">
								<col width="6%">
							</colgroup>
							<thead>
								<tr>
									<th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
									<th>ID</th>
									<th>车型库代码</th>
									<th>车型库名称</th>
									<th>制造商</th>
									<th>系列</th>
									<th>年份</th>
									<th>车型</th>
									<th>发动机</th>
									<th>排量</th>
									<th>功率</th>
									<th>马力</th>
									<th>类型</th>
									<th>起始年份</th>
								</tr> 
							</thead>
							<tbody id="mator_list">
								{notempty name="mator_list"}
									{volist name="mator_list" id="mator" key="k"}
										<tr data-index="{$k-1}"><td><input type="checkbox" name="checked" lay-skin="primary" lay-filter="choose"></td>
											<td>{$mator.id}</td>
											<td>{$mator.field_country_code}</td>
											<td>{$mator.field_country_name}</td>
											<td>{$mator.make_name}</td>
											<td>{$mator.series_name}</td>
											<td>{$mator.year_name}</td>
											<td>{$mator.mator_name}</td>
											<td>{$mator.engine}</td>
											<td>{$mator.volume}</td>
											<td>{$mator.capacity}</td>
											<td>{$mator.horse_power}</td>
											<td>{$mator.m_type}</td>
											<td>{$mator.m_year}</td>
										</tr>
									{/volist}
								{/notempty}
							</tbody>
							<input type="hidden" name="del_mator_ids" value="0" />
						</table>
					</div>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<input type="hidden" name="product_id" class="" value="{$view.base.id}">
				<button class="layui-btn" lay-submit="" lay-filter="addRole">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		    </div>
		</div>
	</form>
	<script type="text/javascript" src="{$PUBLIC_STATIC_SRC.__Home_JS__}/product/productAdd.js"></script>
</body>
</html>